LZW and LZRW compression algorithms and implementation