Added conditional atop flip and unflip function to not rotate if desired rotation equals current rotation