Adds code for lecture 7