finished encoder section