removed an unnecessary if statement and renamed a variable