update flow.R