Implemented window resize