implented multithreading class