added getSamples() to process samples directly