merging codes