write to file instead of displaying