Added Encoder Code