endogenous capital (needs checking)

- results are strange
- documentation is pretty messy