Changed to use Manhattan distance since we're only using 4 directions