cleaned up and minor bug in homo_prob fixed