merge with logic