the main thread now does some of the work