Updated to use MainWindow