basic idea on how to implement the factorization itself