Implemented till exercise 21.