fixed edge case where stepWhile was not being called on a corner surrounded by visited coords