implemented concurrency. 16 threads seems fastest, but only 3x faster than 1 thread