implement a function to write evaluation data recursively