multithreading draft, still need to finish locks