wip. tests passing again. reformated, and using new inner event loop.