pseudo code for map reduce