implementing dictionary search