Should the subsequent references to window should be $window?