working multi-threaded until output