Finished part 4 of assignment 1