multithreading set up between both console and gui versions