added map to encode decode