pushing untested code that using a direct port of simulators way of reacting, plus the deadend avoidence and three-directional gaps