working on demultiplexer