Encoder Working Again

And this time it's optimized!!