Added encode declaration and code format.
Merge pull request #140 from gmist/fix_code_style

Added encode declaration and code format.