Finished. Optimizations welcome. Can use binary search or Hashing.