Writing to file instead of std::out