added more logic for combination checking