for encoding