midstream changes, code currently broken