Code documentation

I have added some code documentation using WA knowledge base.