logic merged