avoid staircase for A*