Added ternary operator

commented out standard conditional statement and added conditional with
ternary operator. Tested in browser.