Added logic to split into seperate csv files