changed conditional to include 2 variable comparisons