implemented the systematic resampling

also changed the resampling interface.