Adding an example tool for using sampler and fixed some size_t type issues