fixes #3: Add to_json method
docstrings