Implemented Problem 24