updated with code and intermediate csv files