Added output ofstream code.
Reduced ifstream passing (doesn't need to go into a print function, after all)