Put encoder in main