Algorithm(16)