added basic multithreading