changed variable name for clarity, added comments