Motor not working when moved to class function

Hey guys, so I got this code here that is supposed to move the stepper motor quickly towards a destination and when it gets close, it needs to slow down and move untill it gets stopped by an interrupt.

#include <AccelStepper.h>

#define sensor 19
// Define a stepper and the pins it will use
AccelStepper stepperElevator(1, 45, 44); // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5
boolean stepRun = HIGH;
int destination = 1000;
boolean something = HIGH;

void Interrupt()
{
  stepRun = LOW;
}

void setup()
{  
  attachInterrupt(digitalPinToInterrupt(sensor), Interrupt, FALLING);
}

void loop()
{    
  if (something){
    int directionElevator;
    if (destination < 0)
      directionElevator = -2800;
    else
      directionElevator = 2800;
    stepperElevator.setMaxSpeed(150);
    stepperElevator.setAcceleration(50);
    stepperElevator.moveTo(destination);
    while (stepperElevator.currentPosition() != (destination - 50)){
      Serial.println(stepperElevator.currentPosition());
      stepperElevator.run();
    }
    stepperElevator.stop();
    stepperElevator.runToPosition();
    stepRun = HIGH;
    stepperElevator.setMaxSpeed(50);
    stepperElevator.setAcceleration(25);
    stepperElevator.moveTo(directionElevator);
    while (stepRun){
      stepperElevator.run();
    }
    stepperElevator.stop();
    stepperElevator.runToPosition();
  }
  something = LOW;
}

The good news is, its working fine, the bad news, when I move this to a cpp file attached to my ino, like this.

#include "ElevatorMotions.hpp"
#include "ElevatorSensors.hpp"

AccelStepper stepperElevator(1, driverElevatorPUL, driverElevatorDIR);
boolean stepRun;

void Interrupt()
{
  stepRun = LOW;
}

ElevatorMotions::ElevatorMotions()
{
  attachInterrupt(digitalPinToInterrupt(sensor), Interrupt, FALLING);
}

void ElevatorMotions::ElevatorMove(int destination)
{
  int directionElevator;
  if (destination < 0)
    directionElevator = -2800;
  else
    directionElevator = 2800;
  stepperElevator.setMaxSpeed(150);
  stepperElevator.setAcceleration(50);
  stepperElevator.moveTo(destination);
  while (stepperElevator.currentPosition() != (destination - 50)){
    Serial.println(stepperElevator.currentPosition());
    stepperElevator.run();
  }
  stepperElevator.stop();
  stepperElevator.runToPosition();
  stepRun = HIGH;
  stepperElevator.setMaxSpeed(50);
  stepperElevator.setAcceleration(25);
  stepperElevator.moveTo(directionElevator);
  while (stepRun){
    stepperElevator.run();
  }
  stepperElevator.stop();
  stepperElevator.runToPosition();
}

and then call it from my ino file's loop like this:

Motions.ElevatorMove(destination);

It stops working, it still goes through the code, wich I know, becouse the print line printing the current position of the stepper still starts printing, and is even updating as if the motor is moving, except its not actually moving.

Any possible solutions welcome, thanks in advance.

You seem to be using .hpp files. Why is that ?

Because this is only the start of the code, a lot more will need to be added in the future and I like the hpp files to help me keep oversight. You think it has something to do with my problem?

I have no idea, but I wondered why you didn't use a normal .h file or a combination of .h and .cpp files to create a library

Come to that you could use a second .ino file in the same folder as the sketch file and it will be compiled into the project with no need to #include it

well, I changed the hpp files to h files, and now its working! Not sure how exactly, becouse I also changed some other things, but regardless, it works and thats whats important. Thanks!

I am glad that it is working but why did you use .hpp files in the first place ?

Because I am working on a project that is supposed to work alongside a similar project that already has an established and working arduino code. My project will have some similarities to that one, so I decided to take it's code structure and build my code in the same way. That code has hpp files, so I used those instead of h files to.