change sum to subtraction in entropy calc