modified the sample to remove unwanted code.