add algo
recorrect the algorithm
Merge pull request #5 from sbashani/master

add algo