Creating MPI function