updating sample with new apprach