Added ability to write to JSON (for future changes)