Modified the problem from this post to also include debt. If someone doesn't have the funds to pay during the turn, they have to borrow money from the person they should be giving it to, and pay back with interest.
Check out the source and the produced animation here: https://gist.github.com/kirillseva/961fa1f5b5d64254e0117caf1...