adds main function
merge