Lecture code and homework from Week 4