Solved problem 7. -Chaz