Improve algorithm for increase speed
Improve algorithm for increase speed