Functions:Personal

a function and ternary combined into one code