REV: Added an optimized animate function.