code related to multiplexing