added multithreaded update function