worked with ternary within a function starting line 24