following CLRS Introduction to Algorithms text