N.S. mass shooting inquiry hears how police ended rampage