rewrite deadCellsLiveOrDie as a ternary operator