implementation of LZW for CPSC 323