pseudo code
merge