corrected maketrees and added cleanup in class ParameterSet