Solved problem #8, added problem #9