Add output file (output_tidy.txt). Remove debug code from R, improve comments.