Finished part 4 of assignment 3