Problem 7, added multithreading