optimized functions in mainwindow.cpp for quicker acces than c++ streams