more sampling stuff added
temporary changes, may have overwritten other changes
merged
streaming and scattering in place, not verified