Attempting to calculate Shannon entropy and KL Divergence