removed draw function local scoping
minor updates
moved slider onChange from html to js function