changed reference to window; added code coverage