modified merging - should work now