added encoder option