Adds multithreading and more docstrings