added beginning code for the main window