Changed iteration order of getNextTile