Removed d.clear(); from scoring_function::clear()