Pulling vezzi's haloplex demultiplexing code