Use the algorithm presented in the book.