exercise 3.1 accumulator