Solution for Problem #28