Commit sample code

Codes based on the sample code provided