Added code documentation
Minor fixes