defining ternary for implementation