done with chap 8 -- replace type code with classes, subclasses, strategy