implementing quad rotation