refactor and mix multiplexing. now working 100%