Documented the code with comments