Added threading to benchmarking