switched samples to be non-pointers