small changes to main function, subsetting dfs