New algorithm based on the book is implemented