more effective way to iterate over data frame