final edition used for hw3_part3