Making a counter

I tried to make a counter which firs x wolud equal to 0, if user press A and x is greater than -1, x would be x-1. If user press D and x is smaller than 1, x would be x+1. I made this to make a 3 lane road but when a condition is not work, x become 0 again. How can i made a x change forever in the code? Here is the code. I tried too much but i couldn solve the problem, i will be so glad if you help:

using UnityEngine;
using System.Collections;

public class karaktersagsol : MonoBehaviour {

	private int x = 0;

	void Update() {
		if ((Input.GetKey (KeyCode.A)) && (x>-1)) {
			iTween.MoveBy (gameObject, new Vector3 (-1, 0, 0), 0.5f);

		if ((Input.GetKey (KeyCode.D)) && (x < 1)) {
			iTween.MoveBy (gameObject, new Vector3 (1, 0, 0), 0.5f);


Use Input.GetKeyDown instead of GetKey.
GetKey will return true every frame the key is pressed down, so it will trigger your conditions multiple times really quickly.
GetKeyDown is only true the frame the button is pressed, so it wont trigger over and over again, and the user will have to lift and press again to enact another change.