Algorithm seems to work. More testing and overthinking the structure necessary.
merged
mentioned in commit c67d4574