change name from decode to encode