Add separate function for combination
Optimize logic for combinations