Ternary statement used for conditional in place of if and else