add comments for the multithreading part