Completed the reduce method and specs