modified serial / MPI version of xyz