fixed tragic bug in entropy calculation