Source code from the book of Horstmann