Needed to reverse the prev_out