lecture 9,10 and Homework 4