Reimplemented the ternary expression for rollCt