second working version, mpi not implemented