added some explanatory comments.