multplexing code updated