add rle algorithm