Updated sample code and comments