Adding comments to MainWindow - cleaning the code