Updated to allow multiple windows to be created