Finish decoder, add encoder