added groovy map reduce code