Added code through p.173
Added code through p.183