Diffrence between Accelstepper commands

Hi Dear forum

Im trying to understand the Accelstepper library and the diffrence between some commands.
for this purpose im writing small diffrent sketches , each with other command, to see if i get the idea.
For some reason, the runToPosition() command is not working as i understand it .

also im somwhat confused between run(), runspeed(), runtoposition(), runspeedtoposition()...
will be glad for a brief explanation of the diffrences- i understand some of them implement accelaration, some are not, some are blocking,some are not, but its not stated clearly for each function.

here is the explanation of runtoposition() command in the accelstepper documantation:

"Moves the motor at the currently selected constant speed (forward or reverse) to the target position and blocks until it is at position. Dont use this in event loops, since it blocks."

i wrote a small sketch , which (for my understanding) supposed to spin the motor 1 revolution and stop.
what happens is that the motor spins constantly, and actually never gets past the runToPosition() command, although it got to its position. here is the skecth, please help ...

// Blue - 28BYJ48 pin 1 - PIN 8
// Pink - 28BYJ48 pin 2-PIN 9
// Yellow - 28BYJ48 pin 3-PIN 10
// Orange - 28BYJ48 pin 4-PIN 11
// Red - 28BYJ48 pin 5 (VCC)

#include <AccelStepper.h>
AccelStepper stepper(AccelStepper::HALF4WIRE,8,10,9,11); // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5
int steps=4076;
int flag=0;
void setup()
{
stepper.setMaxSpeed(900);
Serial.begin(9600);
}

void loop()
{

while (flag ==0 ) { //supposed to be runned once !
stepper.moveTo(steps);
stepper.setSpeed(900);
stepper.runToPosition();
//supposed to run motor to position per moveto command
//and then stop and continue to next code line ??
flag=1;
}

}

So you didnt get a reply,
sorry about that
try stepper.runSpeed(); instead of run to position and you will see it works
im doing a similar thing

#include <AccelStepper.h>
AccelStepper stepper(2, 10, 11); // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5

#include <LiquidCrystal.h>
long RFlag=0;
/*
 The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground

*/
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);


void setup()
{ 
  //Serial.begin(9600);
   pinMode(9, INPUT_PULLUP); 
   // set up the LCD's number of columns and rows: 
  //lcd.begin(16, 2);
  // Print a message to the LCD.
  //lcd.print("Ready");
}

void loop()
{ 
  float FRate = analogRead(A5);//feedrate
  int sensorVal = digitalRead(9); 
  
  // set the LDCD ursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  //lcd.setCursor(0, 1);
  // print the feed rate
  //lcd.print("Feed mm/s ");
  //lcd.setCursor(11, 1);
  //lcd.print(FRate);
  
  
  if (sensorVal == HIGH) {
    
   RFlag=1;    
   stepper.setMaxSpeed((FRate)*2.92);
   stepper.setSpeed((FRate)*2.92);
   stepper.runSpeed();
   
   }	
   
      else {
        if (RFlag==1){
          
   //stepper.setMaxSpeed((FRate)*2.92);
   //stepper.setSpeed((FRate)*2.92);
   //stepper.runSpeed();
 
   
   RFlag=0;
           }
        }
  }
   
}

im looking for my motor to back off one turn when its finished and then stop
work in progress