insertion sorting merging with master