Hereās what I have for the serial version:

```
template <typename F, typename T, typename U>
Eigen::Matrix<typename stan::return_type<T, U>::type, -1, 1>
map_rect_serial(const F& f,
const Eigen::Matrix<T, -1, 1>& shared_params,
const std::vector<Eigen::Matrix<U, -1, 1>>& job_params,
const std::vector<std::vector<double>>& x_r,
const std::vector<std::vector<int>>& x_i,
std::ostream& msgs) {
const char* fun = "map_rect (_serial)";
check_matching_sizes(fun, "job parameters", job_params, "real data", x_r);
check_matching_sizes(fun, "job parameters", job_params, "int data", x_i);
Eigen::Matrix<typename stan::return_type<T, U>::type, -1, 1>
result(job_params.size());
for (int i = 0; i < result.size(); ++i)
result[i] = f(shared_params, job_params[i], x_r[i], x_i[i], &msgs);
return result;
}
```

Two changes:

- constant functor argument
- reference to the messagesāwe should be converting everyting to references going forward

for the second, we do not want to be checking if pointers are `NULL`

everywhereāitās super error prone and also too verbose. Weāll be moving everything to pointers.

This does not even try to get the exact same answer as the MPI version.