Provided the user gives an output directory path, store the final state data into a directory.
Provided the user gives an output directory path, store the final state data into a directory.