ios::out is unnecessary if you use ofstream