Basic KNN Solution and utils