partial answer of hw4
finish hw4