Used hash table instead of String#index for index lookup.