functions for returning metric map and giving invariant hashCode