Fixed entropy calculation