slide algorithm improved