some improvments, mpi_gather maybe buggy