Reduced the grid to look for shortest path to DIST * DIST + 1 square length. Now we can use any map size we want.