implemented donut stack

- re-organized API
- added donut closure
- added donut stack closure