Added multiplexing code