accommodating for extremes: when there are too many rows, sample function goes crazy