Rewritten using kinetic.js.