Modified sorting algorithms so that files are chosen form all directories in a round-robin fashion with files from directories with more files being referred.