added sort for files

Need to  test fro perfromance