Now generates output.csv when given appropriate permissions