put avg in the middle