Improvements to animate code.