Add transition easing. Clean up code.