add clone and toString func for sample.

improve sample structure.