-added input and output directory.
-added output writing.