Working main loop parameterized by reporting fns