add enc/dec functions