def map_sorted(hash)
      hash.keys
          .sort_by(&:to_sym)
          .map { |k| yield k, hash[k] }
    end
def map_sorted(hash)
      hash.keys
          .sort_by(&:to_sym)
          .map { |k| yield k, hash[k] }
    end
Maps hash yielding key-value pairs ordered by key