Changed encode definition.
Merge pull request #54 from gmist/encode_defining

Changed encode definition