Wrote a function to locate tiles on the grid.