main() moved to mediator(). main() now calls mediator()