Code solutions to problem 4.

4(b) needs test cases.