Added a way to calculate entropy