modification to saha to fix some of the problems in #40