bug fix in entropy computation