added hack to merge which now works. This is not the most efficient
way to implement this though, but it works!