Added an even fast implementation with O(1) lookup time, but at the cost
of taking a lot of memory