implement 3 stages of search, and add b prefixes to dict