set up multithreading