Updated mapper and reducer