add combinations and set matrix zeros