https://github.com/vvirkki/flow-regime-changes