finished Assignment4 part II