solves lvl-b8, needs optimization and cleanup
completes lvl-b8
fixes bug where transitioning from unsafe, to safe conditions wasted a turn