part 3 working on reduce