edits to resampling for Ryan