Programming exercise 1 solutions