Added Encoder to main functions