corrected cnf to poly algorithm