fix rotation the right way, not using a static variable