correct getTrailPosition function, add a simd merge loop function, not completed.