added mpi communication
fixed off-by-one in hashvalues