finally got rotation functions completely functional