Code from class, plus the homework assignment for Week 1.