Tweaked...need to print out output to a file next.