Updated flow algorithms