updated comments in code for clarification