script for writing csv done