pdated algorithm code
Resolved conflicts
Merge branch 'master' of github.com:Aleyasen/Alaki into haoran