turned the code from O(n^2) to O(nlog n), 112 sec -> .27 sec LOL