merging two solutions