change logic for encoding