added merging stuff