prefer to use ostream instead of iostream