Porting sampling strategy to thread local design
Merging branch