added explanatory comments into the code