Working on reduce function.