use threads for matrix multiplication