finished chapter 6 examples (code)

Signed-off-by: Chris Jones <chris@jonezy.org>