Pass ostream as a parameter