updated according to CH 5 in the book