cleaned up to work from command line;
changed for to doseq which works in command line
added println to show progress in command line
changed to write to current directory