Added appropriate comments in code