http://chogg.name/projects/smooth-animation