Implement the main window