This is some code from the book Head First