Changed output data format, added average values output