average and ouput format fix