Getting there again...

Rewrite using a lot of Martin's original code and logic. Building the
file one step a time to make sure we don't get too lost again.