add a form resize event handler
clean up unused function