made leaf rotate and also cleaned up code