Implemented K-nn