Hashcode implemented for Pair