Add option for outputting dispersion

Here's the pull request you requested. It is split into two commits because you may not want the second.