i think it is considered better practice to declare the var outside of the if statement.