first attempt at multithreading