Solution for Problem #48