Looking at this more carefully, I think you meant to change "capital_used" in the comment above to "cash_flow", and it looks like you're changing the state variable from capital_used to cash_flow, is that right?