Updated, added toJSON() method