Making merge script a little more memory friendly.