map via reduce.