updating to multithread