added more explanatory comments