added comments & changed a variable name