added merge_holes function