added toObj for easy json conversion