Same as #47, but quite a bit harder as even more bookeeping is needed. Might not even be possible without a element-by-element for-loop.