big modify for knnRerank.m