Added threadpool library with threading.
Improved parameters and removed testing lines.