Writes out files, plus takes averaged runs