Function Output changes by commenting out a line of serial.print

I’m trying to set up a capacitive touch sensor on an Arduino UNO. I’ve had the buttons working for awhile. I’m now trying to add the ability for short touch or long touch. The code below is what i have so far. There will be 3 button total so i made a function to track how long they are held for.

My issue is if i remove the Serial.print(Start) from the function it seems to stop returning the Press value and instead I think returns the Start value. Rather than the value being small and changing up/down it’s just keeps increasing with each button press.

I’m new to returning values from a function and I’m stumped as to why it interacts like this. I can leave the line in there it won’t be outputting to the serial monitor when complete. But i would like to figure out why it’s doing that.

#include <CapacitiveSensor.h>         // For the capacitive sensors

CapacitiveSensor   cs_2_3 = CapacitiveSensor(2, 3); 

int Switch;
long Start, End, Press;
unsigned long Cap1Press;

void setup() {


void loop() {

  unsigned long Cap1 =  cs_2_3.capacitiveSensor(30);

  Cap1Press = buttonPress(Cap1);

unsigned long buttonPress(unsigned long Cap)
  long Start, End;
  if (Cap > 150 && Switch == 0)
    Start = millis();
    Switch = 1;

  if (Cap <= 150 && Switch == 1)
    End = millis();
    Press = (End - Start);
    Switch = 0;

  /* If i comment out this next line it stops working*/
  return Press;

Watch your ‘type’s.

millis() returns ‘unsigned long’

Thank you. Fixing those issues straightened out.