Newby question sensor memsic 2125 output question

Hi,
I use the sensor memsic 2125 for my self balancing project. Having so trouble and hope someone can help me with that.

The sensor output is not 100% stable. Values are jumping. something like: 0-8-0-0-0-8-16-8-0-0-0-8-0-0-0-16-8-0-0-0 this is sent to pwm for activating servo.
Already used the condensator 0.1uf and stable power supply as recommended.

  1. I want some want to stabilize this output. For example use the average of the last five sensor outputs or somehow smooth the signal another way.
    What do you suggest?? how to write the code for the average output?
  2. The output is linear now. I want is to be less sensitive around the '0' and more when the values get greater. is this exponential or progressive?
    What is the formula for that?

The code I used is the standard coder from arduino memsic 2125

// read pulse from x- and y-axes:
pulseX = pulseIn(xPin,HIGH);

// convert the pulse width into acceleration
// accelerationX and accelerationY are in milli-g's:
// earth's gravity is 1000 milli-g's, or 1g.
accelerationX = ((pulseX / 10) - 500) * 8;

leftServo = (accelerationX);
leftServo = map(leftServo, 1000, -1000, 179, 1);
myservoLeft.write(leftServo);

I tried to search the forum but cannot find the correct answer to my questions.
I really hope someone can help me with the issues.

Thanks, Jerome