Applied use of remove sample function