documentation done, and minor changes in code

documentation done, and minor changes in code also done. added
documentation in PDF.