much better threading using a threadpoolexecutor