fixed more bugs.  cleaned up docs.