Pulled out window resizing to its own function