Created logic to merge contacts logic