Fix bug and clarify variable name