Added some LZ logic