implemented div rotation through click and hover and cleaned the code