changed ternary from 0 to 1