added option: saveSamples