Implement the first sample from doc