add function to merge two numbers for selected positions