adding csv writing script