worked through lecture 7 exercises