Create a Simple Spline Escalator system

hey this is really cool, i got it working in just a few minutes.

my only issue is i need a specific number of steps to fill a preset spline length and i dont quite understand the maths
surrounding the compare step distance and spline length.