added comments for clarification