updated mux and demux code + added tex for report