Update Encoder.pm

Made it so that were were using keys instead of values. Fixed a bug