added new instance method to allow injection of the window array