merging files
Greedy algorithm added for initialization