merging traverse codes