changed calc of log( 1 + exp(zy) )