Testing the algorithm from http://antirez.com/news/71