changed entropy implementation