basic functionality of tile flipping