Adding logic for category intersection