got 2d averageing working