begin entropy calculation