added averages as json output