first half of atom mapreduce