Updated combinational with encoder and demux