changed takeoff if else to ternary operator