Almost ready for making the report.

After that, all that's left is input argument checking, and perhaps
some mroe test/illustration programs.