implemented resizing of the window