Added parameter to write results of measures to a csv file.