modified sample_wor interface (tested)