Improved reading implementation
Implemented writing to JSON