added some code for the sample