Added d1 to flow functions