redo of the homework 4 assignment