Added some comments and sample code