removed redundant “ord” parameter from plotAverage function