basic logic of program
merge