Send values to an array, write to CSV when full

You didn't.