Rewrote the multithreaded version to split the problem into an arbitrary number of parts as opposed to n/2 parts