Solution to the assignment.