Created function to form the 2D grid of tiles