Function for resizing window done