added sticky sampling algorithm