I know I've said this before, but the math is fixed!

There were so many problems!  But it works on event the hard test data
now.  It still has all the debugging code in it.  I need to clean it
up, but here is a working version.