finished findsatisfying and setvartrue functions