chapter2 code from David Geary's Core HTML5