add filtering dir test and file *.bak
quick sort
minimum distance