Created by: BrianLunder
This will reduce the runtime of the code code from O(n^3) to O(1). I promise.