added tile logic