add and replace function
correcting conflicts