Refactored lzwEnc a little