Fixed a horrible loop coding error where it was doing n*n > comparisons