Decreased run time.

Changed variable names and changed the range for the second range to
not go through every element.