add more rules for encoding