Completed if, else, ternary - revised