enabling multithreading, cleaning up outputs