Implemented divide-and-conquer recursion. MUCH faster.