fixed a problem with mutual information function, and put it in a seperate file