encoding almost done