Solution for Problem #34