Added periodic output to csv