worked through lecture 8 exercises