Testing code from the book