(Solved)Steppermotor and serial.print and read combined

OK so the timingtable/storyboard should look like this:
1]
Start puls received from PC
Startflag = 1
Read in maximum value of compression ....35 mm from PC so counterMax is 35
Save current raw force value > rawValue.
Start rotation downwards in 18 degree steps = 0.1 mm
1 sample per 18 degree step = 0.1 mm
Measure raw force value each 18 degree step
rawValueOld = rawValue

2]
If rawValue > rawValueOld
counter = 0
Recordingflag = 1
send reset signal to pc so force value is set to zero
send reset signal to pc to start recording force and step value
Rotate motor in 180 degree steps
Serial.print(rawvalue)
Serial.print(counter)
Counter--
3]
if counter == counterMax (35)
Recordingflag = 0
Returnflag = 1
send reset signal to pc to stop recording force and step value
Rotate motor in 180 degree steps upwards
counter++
4]
if counter = - 4
Stop motor
Startflag = 0
Returnflag = 0

Paco