Yeah, so why not take each item in the history roArray and enter it into a roAssociativeArray? Do a lookup before adding a new value to the search history. If you load the roAssociativeArray at application startup, then you can scan then history array once -- and before adding something to the history, you can just do a quick lookup in the roAA. As you add things to history, you can also add to the associative array. Assuming the roAA DoesExist function is O(1), this is more efficient from a performance standpoint and definitely from a coding standpoint. If case sensitivity ever becomes a concern (unlikely), then you have that built in too.