change encoding algorithm