make encoder and decoder