almost working on larger data set