make it more robust for big data sets