added Sketchpad javascript functionality