modified to use csv