added csv writer function