Some refactoring: avoid re-parsing the expressions, remove the necessity for a seperate unknowns file and better loops