Cleaned up team3's RLE implementation.