add mattieu merge code