Added thread alg.