you don't need to assign to lse here, just return math.Log(lse) +maxval