Added command to write to file.
Reformatted docstrings.