I removed the return command, but I still can't get it to read the pulsin variable within the subroutine. It it impossible? What should I do?

start:
pulsin PORTB.1,1,widthx
IF widthx >= 50 && widthx < 70 Then run_motor1
IF widthx >70 && widthx <90 Then Goto run_motor2
IF widthx >90 Then
Goto run_motor3
Else
Goto brake
Endif

run_motor1:
Low Brake1
motor_dir = CW
motor_speed = 50
Gosub pwm_periods
While (widthx >= 50 && widthx < 70)
Gosub pwm_pulse
Wend
Goto start