updating functionality for reading in samples