resampler and weight update routines further modified for better stability