add encode and decode features