partially completed lzwencoder, fixing problems