how to solve factoring?