fix all permutations calculation in LVCS alg.