Lecture 6 of CS193p