Adding flow calculations