[wip] RSDayFlow Backport

No concrete dates yet but it helps to have a pull request.
naïve mistake (mine), should use a less fancy C loop