Added function to make sure rotation fits before executing it