Improve algorithm and comments.
Improve algorithm and comments.

rnixx/kivy,KeyWeeUsr/kivy,matham/kivy,akshayaurora/kivy,bionoid/kivy,jegger/kivy,LogicalDash/kivy,jegger/kivy,inclement/kivy,bionoid/kivy,kivy/kivy,rnixx/kivy,KeyWeeUsr/kivy,Cheaterman/kivy,KeyWeeUsr/kivy,inclement/kivy,akshayaurora/kivy,bionoid/kivy,LogicalDash/kivy,akshayaurora/kivy,jegger/kivy,matham/kivy,Cheaterman/kivy,jegger/kivy,bionoid/kivy,LogicalDash/kivy,matham/kivy,LogicalDash/kivy,KeyWeeUsr/kivy,Cheaterman/kivy,rnixx/kivy,kivy/kivy,matham/kivy,Cheaterman/kivy,kivy/kivy,inclement/kivy