adding ternary snippet