added code samples in docs