Added more explanatory text and comments.