changes to build_dictionary functions