coroutine
almost functional (yeah no)