minor edits
various code editions.  In theory, this should now be numerically stable.  Probably need to switch to gnuplot