Clarified comments and changed a variable name