Ripping from HTML5rocks to learn some canvas animation