in reply to sorting out directories

Use the sort function.