Added Lecture 7 code