rotate/flip made better