algo almost done