added functions avg_col, avg_row
added functions avg_col, avg_row