moved opt code to the end of options