changed CustomWritable to comparable and sorted values in reduce