fix direction based on rotation angle and refactor acceleration