Cleaned up sampling, and implemented fragmenting of data samples for very large datasets