started error handling for sig NaN
trying to merge...
hopefully get the code working
trying to merge some more...
exception handling for negative sig2, and minor integration change