added skeleton for merging, need to fix lowest index of sorting