Updated for encoding options