updated object function passing object and json as arg outputting to main code