Finished the encoding side