Lecture 4 with updates from the code on the website