implementation of LZW file compression in Ruby