Solution for Problem #35