coding #3 adding new functions in the mainwindow