Made the main window an object