Changed some structure and added a function for finding a tile.