1007 describe the algorithm in details.