refactored rotations to be more idiomatic