Clean up code and fix rotation issue