copy sample from tmlib example.