Smoothing multiple sensors

I am in the process of developing a 4-channel fan controller based upon using input from 4 temperature sensors. I have the single channel code working like a charm, however I am at a loss on how to smooth the input from 4 input channels, keep them seperate, and control 4 channels of output.

What changes do I need to make to make this code x4? I have been bashing my head against the desk for 3 days and can't seem to figure it out. Any help would be greatly appreciated.

const int numReadings = 5; // how many readings to average
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

void setup(){
for (int thisReading = 0; thisReading < numReadings; thisReading++)
readings[thisReading] = 0;
}

void loop() {

total= total - readings[index]; // subtracts the last reading
readings[index] = analogRead(inputPin); // reads from the sensor
total= total + readings[index]; // adds the reading to the total
index = index + 1; // advance to the next position in the array
if (index >= numReadings) // if we're at the end of the array
index = 0; //wrap around to the beginning
average = total / numReadings; //Averages the readings
}

Make 'readings' two dimensional, and add another loop to sum across four sets of readings.

const int numReadings = 5;   // how many readings to average
const int numChannels = 4;
int readings[numChannels][numReadings];   // the readings from the analog inputs
int index;               // the index of the current reading
int totals [numChannels];               // the running total
int average [numChannels];             // the average

void setup(){
}

void loop() {

  for (int chan = 0; chan < numChannels; ++chan ) {
     total[chan]= total[chan] - readings[chan][index]; 
     total[chan] +=analogRead(inputPin [chan]);

//blah, blah

facepalm

You, sir, are my hero.