minor edits in generate_clustering_tree and assign_codewords