Changed entropy calculation slightly