cubie flip and rotation && clean up