CHANGED added optional parameter to write to file in version