added functionality to split the dataframe