finalized rotation functions.