half way done with encode.