improve code for replay, use lzw compression instead of run length compression.