encode the options