Add solution to exercise five in the second assignment.