added print option to createJSON()