implemented KL divergence using histogram