added/edited comments for clarification