rats function

data from Exercise 7.13, p225