first attempt to solve random rectangle
finish solution for walking on grids