Stepper motor problem

The program I am writing involves a stepper motor that upon power up steps a certain number of times to go back to its home position. Right now however when I call the gohome() function in the setup() it only does between 10 and 30 full revolutions before it stops an runs the loop() function. It should do 340 full revolutions. Can someone take a look at my code and see what the problem is? I had it working before I wired everything fully together with a smaller step size. But when I finalized everything only the gohome() function stopped. All other functions work fine and the stepper steps the correct number of revolutions. Some code deleted out to stay within forum character limit. gohome() is 2nd function from the bottom.

#include <OneWire.h>
#include <DallasTemperature.h>
#include <Stepper.h>

const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
const int dirA = 12;
const int dirB = 13;

int currentlargestindex = 0;
int previouslargestindex = 0;

const int STEPS = 200;

const int STEPS0 = STEPS * 0;
const int STEPS1 = STEPS * 80.64;
const int STEPS2 = STEPS * 161.28;
const int STEPS3 = STEPS * 241.92;
const int STEPS4 = STEPS * 322.56;
const int STEPSHOME = STEPS * 340;

Stepper myStepper(STEPS, dirA, dirB);

#define ONE_WIRE_BUS 2 
OneWire ourWire(ONE_WIRE_BUS);
DallasTemperature sensors(&ourWire);

DeviceAddress Probe01 = { 0x28, 0x86, 0x66, 0x67, 0x04, 0x00, 0x00, 0x43 }; 
DeviceAddress Probe02 = { 0x28, 0x49, 0x36, 0x67, 0x04, 0x00, 0x00, 0x6D };
DeviceAddress Probe03 = { 0x28, 0xC7, 0x6B, 0x67, 0x04, 0x00, 0x00, 0xED };
DeviceAddress Probe04 = { 0x28, 0x56, 0x40, 0x67, 0x04, 0x00, 0x00, 0xE3 };
DeviceAddress Probe05 = { 0x28, 0xCB, 0x3D, 0x68, 0x04, 0x00, 0x00, 0x03 };

void setup()
{
  Serial.begin(9600);
  Serial.print("Initializing Temperature Control Library Version "); 
  Serial.println(DALLASTEMPLIBVERSION);
  
  sensors.begin();
  
  sensors.setResolution(Probe01, 12);
  sensors.setResolution(Probe02, 12);
  sensors.setResolution(Probe03, 12);
  sensors.setResolution(Probe04, 12);
  sensors.setResolution(Probe05, 12);
  
  /* Rotation speed of motor, 45 RPM in this case */
  myStepper.setSpeed(45);
  
  pinMode(pwmA, OUTPUT);
  digitalWrite(pwmA, HIGH);
  pinMode(pwmB, OUTPUT);
  digitalWrite(pwmB, HIGH);

  pinMode(brakeA, OUTPUT);
  digitalWrite(brakeA, LOW);
  pinMode(brakeB, OUTPUT);
  digitalWrite(brakeB, LOW);
  
  gohome();
  Serial.println("at home");
  
  /* logs some data */
  Serial.begin(9600);
}

void loop()
{ 
  fillarray(temperaturearray); //puts the temperatures in an array
  Serial.println("array filled");
  highestTemperature(temperaturearray); //finds the hottest temperature
  Serial.println("highest temp ");
  Serial.println(hottest);

  if (hottest == temperaturearray[0])
  {
    Serial.println("at 1st");
    gotofirstsensor();
  }
  else if (hottest == temperaturearray[1])
  {
    Serial.println("at 2nd");
    gotosecondsensor();
  }
  else if (hottest == temperaturearray[2])
  {
    Serial.println("at 3rd");
    gotothirdsensor();
  }
  else if (hottest == temperaturearray[3])
  {
    Serial.println("at 4th");
    gotofourthsensor();
  }
  else
  {
    Serial.println("at 5th");
    gotofifthsensor();
  }
  delay(10000);
}

float highestTemperature(float temperaturearray[])
{
  int arraylength = sensors.getDeviceCount(); //knows how large the array is
  hottest = temperaturearray[0]; //sets the intial largest temperature to the first value in the array
  previouslargestindex = currentlargestindex; //sets the previous largest index to the largest index now, which will change shortly in the loop below
  Serial.print("previous largest index = ");
  Serial.println(previouslargestindex);
  
  for(int i = 1; i < arraylength; i++) //loops through the array 
  {
    if(temperaturearray[i] > hottest) //looks for any numbers larger then the current largest
    {
     hottest = temperaturearray[i]; //if any numbers higher then current largest, it makes that vaule the new largest value
     currentlargestindex = i; //saves the index of the largest number for use in determining where to send the motor.
    } //end if statement 
  } //end for loop
  Serial.print("current largest index = ");
  Serial.println(currentlargestindex);
}

void gotofirstsensor()
{
  if(previouslargestindex == 0)
  {
    Serial.println("doing nothing at 1");
    delay(1000); // does not step the motor. It is already in the correct position
  }
  else if(previouslargestindex == 1)
  {
    Serial.println("going to 1 from 2");
    myStepper.step(-STEPS1); // steps the motor towards the first sensor
  }  
  else if(previouslargestindex == 2)
  {
    Serial.println("going to 1 from 3");
    myStepper.step(-STEPS2); // steps the motor towards the first sensor
  }  
  else if(previouslargestindex == 3)
  {
    Serial.println("going to 1 from 4");
    myStepper.step(-STEPS3); // steps the motor towards the first sensor
  }  
  else
  {
    Serial.println("going to 1 from 5");
    myStepper.step(-STEPS4); // steps the motor towards the first sensor
  }  
}


void gohome()
{
 myStepper.step(-STEPSHOME);
} 

float fillarray(float temperaturearray[])
{
  sensors.requestTemperatures();
  temperaturearray[0] = sensors.getTempC(Probe01);
  temperaturearray[1] = sensors.getTempC(Probe02);
  temperaturearray[2] = sensors.getTempC(Probe03);
  temperaturearray[3] = sensors.getTempC(Probe04);
  temperaturearray[4] = sensors.getTempC(Probe05);
}

If mystepper.step() expects an integer the value 200 * 340 is too large.

…R