implemented demux and circuit tests