Week 6 solution