Begin Algorithms 6.2