Update with resample

Updated code what resampling partially implemented...require fixing up
otherwise will crash.