Added ternary operator

Switched one of the regular if statements to use the ternary operator