updated mutual information calculation