Modified code for reading csv file