Moving the wrong way on the x Axis (Camera Moving Script)

using UnityEngine;
using System.Collections;

public class CameraScript : MonoBehaviour {

 private float speed = 1.0f;
 private float acceleration = 0.2f;
 private float maxSpeed = 2.2f;

 [HideInInspector]
 public bool moveCamera;

 void Start () {
     moveCamera = true;
 }

 void Update () {
     if (moveCamera) {
         MoveCamera ();    
     }
 }

 void MoveCamera() {
     
     Vector3 temp = transform.position;
     
     float oldX = temp.x;
     float newX = temp.x - (speed * Time.deltaTime);
     
     temp.x = Mathf.Clamp(temp.x, oldX, newX);
     
     transform.position = temp;
     
     speed += acceleration * Time.deltaTime;
     
     if (speed > maxSpeed)
         speed = maxSpeed;
     
 }

}

That’s my code to move my camera, and it works, but its going the wrong way, I’ve tried everything to get it to go the opposite direction, and it just wont. Any suggestions?

your problem would not be in this section of code. post your section that determines speed and accelleration. (or whatever inputs are determaning these variables).

speed or accelleration should become negetive numbers to go an opposite direction on the x axis.