got the main program into a state where it can take the average of a
table by column