Add factorization algorithm