Hi Alvaro,
> This looks super baroque. Why not simplify a bit instead? Maybe> something like>> [...]
Fair point. Here is the corrected patch.