In this paper, we report work on a family of variable-length codes with less redundancy than the de facto flat code used in most of the variable size dynamic dictionary based compression methods. The experiments show that by replacing the flat code with these codes in the original LZW compression algorithm, nearly 3%?7% redundancy can be removed, whereas up to 72% improvement can be obtained for a running sequence from the artificial Canterbury corpus.