Reshuffled a few things to make the MPI implementation easier.