Computes all combinations correctly