algorithm 15 747