Code difficult to get right
Code from ch07 ch08 and ch09. More to go from ch09