Completed part 1 of the 4th homework