added toJSON()