change the data structure  for defs from vector to multimap