started refactoring sample to do resampling at load time instead in realtime callback