fixed some merger code
still need to test