Completed the ternary assignment