Made some more changes to the sample code.