Guidance requested: Slot Car race timer and other cool features.

I've been using Arduino ever since I built my first 3D printer about 4 years ago. Since I was already familiar with the technology, that's what I decided to use for my current slot car project. My current setup is a section of track with two photo sensors for each lane.

As I started building the circuit, weird goofy electrical interference things began to happen.. Both sensors are hooked up to the +5v, lightPin at A0, and triggerPin at A4. This simple sketch was a just to get a feel to see if I could get something working. The strange part is when I hold the A4 wire in my hand, the sensor works. When I remove my hand it stops. The sensor at A0 works the same regardless. I figured a simple sketch like this would help me get up and running. Also, I'm strongly considering using a hall sensor to detect the cars as that would help eliminate false readings and detect only the cars.

Any tips or suggestions would be greatly appreciated!

const byte lightPin = 0;
const byte triggerPin = 4;

int lightSensor = 0;
int triggerSensor = 0;

void setup(){
Serial.begin(9600);
pinMode(triggerPin, INPUT);
pinMode(lightPin, INPUT);
}

void loop(){
lightSensor = analogRead(lightPin);
triggerSensor = analogRead(triggerPin);

if(lightSensor < analogRead(1)){
Serial.println("Sensor 2 triggered");
}

if(triggerSensor < analogRead(1)){
Serial.println("Sensor 1 triggered");
}
}

What is connected to analog pin 1 or A1 ?

if(lightSensor < analogRead(1)){
Serial.println("Sensor 2 triggered");
}

if(triggerSensor < analogRead(1)){
Serial.println("Sensor 1 triggered");
}

I first started this project by looking at someone else's arduino slot car sketch to get some ideas. In the comments section he had a wiring diagram showing analog pin 1 hooked up to a potentiometer to adjust the sensitivity of the light sensor. It was very strange because nowhere in the code was that pin even used in the sketch, but still functions exactly as described. Is that some kind of built in function that people just have to kinda "know"?

No, it was probably left in by accident or you didn't copy it fully.