encoder and decoder finished