helped some of the tile logic