FEATURE: writes output to file