Modification to complete homework 3, part 1