Added toJSON functions and Stuff