update extract_head_byte
refactoring. add arithmetic_buffer