Code from class and homework for Week 1