Resampling: An improvement of importance sampling in varying population size models