Modified output writer so some cells are combined and an average value is printed in the output file