finished the sorting file feature