Added useful comments to MainWindow functions