finished encode