moved rotation functions into separate file