Added some functionality and documentation to MainWindow class