Refactored variable naming so variables are not ambiguous