Rethink and implement algorithms in CLRS