Problem 31. (Improve!)