Finished coding for part 4