added toJSON methodS