generate tournament function
merge