Build out algorithm for RLE compression