implementing functions
merge