added self explanatory comments