moved display flipping into main control