Added code for sorting the tasks based on directory/filename.