added window control buttons and implemented window resize