this is exercise 9 from the end of precourse