changed logic to include dividing up files by rank