Finalized code after Week 7