updated merge script