Sync chap 7 code with most recent chap 6 updates

Performed a diff in Eclipse and moved over changes.