changed inverse routine back to using modified damped least squares
documentation and cleanup