An exercise solution.