small cleanup regarding variable scoping, and fix the comment to indicate what does the user is meant to do