added ternary assignment