added more explanatory comments.