Completed exercise 7 to part 4