encapsulated all canvas stuff into its own object in index.html
fixed merge conflict