working farthest insertion