expanded chapter copy; backporting code comment improvements