messy start of framework for dynamic resizing of the sketchpad