practice code for http://shop.oreilly.com/product/0636920028857.do