Solve problem 46.
Solve problem 59.
Add some comments.