Finished part1 of assignment 1. Finished reduce() function