better output and create result file