Updated lecture 7