upload
added KMG diff algo
KMG algo added