Completed part 1 of homework 4