Added docstrings and IOError