CTCI 18.7 fix