correct version of add_sample