threaded execution logic nearly finished