add functions to sample