merge spans