Rewrote JS functions in easelJS