Added window treatment functions