[PATCH 2/3] Build a tree of code words