updated merge script to work with separate logging file.