Changed dict_to_key return type to tuple of tuples