cleaned sample's code.