implemented code for resampling wheel