minor var renaming and comments