Implemented Problem 52