faster implementation: no permutation matrix