output to a result.txt and status