lecture 6.4, assignment 7