How to read three readings & average each

Hi,
Am reading from an accelerometer x,y,z and want to average 10 readings on each axis to reduce the noise.
How do I do it?
I have done it for one (x) but can not do it for the three at once.
Please help!
Here is the code for only one pin
const int numReadings = 10;
int readings[numReadings]; // the readings from the analog input
int index = 0; // the index of the current reading
int total = 0; // the running total
int average = 0; // the average

int inputPin = 0;

void setup()
{
// initialize serial communication with computer:
Serial.begin(9600);
// initialize all the readings to 0:
for (int thisReading = 0; thisReading < numReadings; thisReading++)
readings[thisReading] = 0;
}

void loop() {
// subtract the last reading:
total= total - readings[index];
// read from the sensor:
readings[index] = analogRead(inputPin);
// add the reading to the total:
total= total + readings[index];
// advance to the next position in the array:
index = index + 1;

// if we're at the end of the array...
if (index >= numReadings)
// ...wrap around to the beginning:
index = 0;

// calculate the average:
average = total / numReadings;
// send it to the computer (as ASCII digits)
Serial.println(average, DEC);

int readings[3][numReadings];

Some nested loops, and you're there.

I believe AlphaBeta has published an averaging class in the Playground.