encoding labels and literals