Filling base idmerging code