flip detection and infinite rotation