Changed the window resize function to resize properly.