modified to output a .txt space delimited