dump now takes an ostream&