Implemented pthreads per row