Solution for Problem #12