Changed an if statement to a terniary operator.