still working on the multi-threaded implementation