Week 6 code.