fix for wierdness involving math.exp