Added docs as well as code comments