added option to append results to a csv file. (useful for multiple
executions)