made decoding more optimal