adding tile logic