add json output (not tested)