Code trying to achieve re sizing of the windows.