reverted to master version of mainwindow.cpp