Added the ternary to the code.