Added window resize and input handler