Old Code for samples