Changed the code to load the main window programically.