Solution to Problem #8 completed