fixed some bugs and added gaussian weight and weighted knn function