added resizing functionality to resize if the window resizes