add the right code from the book