script for kNN