added some utilities for subsampling and reading in data