finished off demultiplexing stuff