Finished the encoding for DAA