Added more options to encode