Formalized the two-way-lookup data structure