finish KL_divergence method