map reducer for array of hashes