Implemented exercise 7