fix errors in Week 3 code