implemented mapreduce interface with test